//
//  ViewController.m
//  PDFDemo
//
//  Created by 李煜 on 2023/12/21.
//

#import "ViewController.h"
#import "PDFWebView.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc] init];
    [configuration.preferences setValue:@YES forKey:@"allowFileAccessFromFileURLs"];
    PDFWebView *webView = [[PDFWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
    [self.view addSubview:webView];
    NSURL *pdfFileURL = [[NSBundle mainBundle] URLForResource:@"git.pdf" withExtension:nil];
    [webView loadPDFFile:pdfFileURL];
    
}


@end
